On opt_nosmp, also force num_cores to 1. Do this in setup.c
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 27 Jul 2005 11:20:47 +0000 (11:20 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 27 Jul 2005 11:20:47 +0000 (11:20 +0000)
instead of cpu/common.c. This is where opt_nosmp is defined,
and it reduces diff of cpu/ subdir against native Linux.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/cpu/common.c
xen/arch/x86/setup.c
xen/common/domain.c

index 13628447aa35d4d813f1712915663377ea54c75d..49661af7d84fff8670d223da22352524e3dee0d5 100644 (file)
@@ -427,17 +427,12 @@ void __init detect_ht(struct cpuinfo_x86 *c)
        u32     eax, ebx, ecx, edx;
        int     index_msb, tmp;
        int     cpu = smp_processor_id();
-       extern int opt_nosmp;
 
        if (!cpu_has(c, X86_FEATURE_HT) || cpu_has(c, X86_FEATURE_CMP_LEGACY))
                return;
 
-       if (opt_nosmp) {
-               smp_num_siblings = 1;
-       } else {
-               cpuid(1, &eax, &ebx, &ecx, &edx);
-               smp_num_siblings = (ebx & 0xff0000) >> 16;
-       }
+       cpuid(1, &eax, &ebx, &ecx, &edx);
+       smp_num_siblings = (ebx & 0xff0000) >> 16;
 
        if (smp_num_siblings == 1) {
                printk(KERN_INFO  "CPU: Hyper-Threading is disabled\n");
index ed010f88dca89322aa5772d53626e846db708ba3..dba4b547609668207bdfd13c505bd18310bcd9dc 100644 (file)
@@ -35,7 +35,7 @@ integer_param("xenheap_megabytes", opt_xenheap_megabytes);
 #endif
 
 /* opt_nosmp: If true, secondary processors are ignored. */
-int opt_nosmp = 0;
+static int opt_nosmp = 0;
 boolean_param("nosmp", opt_nosmp);
 
 /* maxcpus: maximum number of CPUs to activate. */
@@ -197,7 +197,12 @@ static void __init start_of_day(void)
         set_in_cr4(X86_CR4_OSXMMEXCPT);
 
     if ( opt_nosmp )
+    {
         max_cpus = 0;
+        smp_num_siblings = 1;
+        boot_cpu_data.x86_num_cores = 1;
+    }
+
     smp_prepare_cpus(max_cpus);
 
     /* We aren't hotplug-capable yet. */
index f83900a0c6578300b1323086a42888cdaa76cca0..b939d90f77099a8aa56c5bfba29bdc026b134c0d 100644 (file)
@@ -39,8 +39,8 @@ struct domain *do_createdomain(domid_t dom_id, unsigned int cpu)
     atomic_set(&d->refcnt, 1);
     atomic_set(&v->pausecnt, 0);
 
-    d->domain_id   = dom_id;
-    v->processor  = cpu;
+    d->domain_id = dom_id;
+    v->processor = cpu;
 
     spin_lock_init(&d->big_lock);